package service.impl;

import dao.HealthTipMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.HealthTip;
import service.HealthTipService;

import java.util.List;

@Service
public class HealthTipServiceImpl implements HealthTipService {

    @Autowired
    private HealthTipMapper healthTipMapper;

    @Override
    public List<HealthTip> findAll() {
        return healthTipMapper.findAll();
    }

    @Override
    public int add(HealthTip healthTip) {
        return healthTipMapper.addHealthTip(healthTip);
    }

    @Override
    public int update(HealthTip healthTip) {
        return healthTipMapper.updateHealthTip(healthTip);
    }

    @Override
    public int deleteHealthTip(Integer id) {
        return healthTipMapper.deleteHealthTip(id);
    }

    @Override
    public HealthTip findById(Integer id) {
        return healthTipMapper.findById(id);
    }
}